<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.tooltip');
$count = count($this->items);
$_column = 4;
$_row = ceil($count/$_column);
$per = floor(100/$_column);
?>
<link rel="stylesheet" href="<?php echo JURI::root().'components/com_shop/assets/'; ?>style.css" type="text/css" />
<div class="search_title_head">
Tổng số kết quả tìm được <span style="color:#F00; font-weight:bold;">( <?php echo $this->total; ?> ) </span> kết quả
</div>

<table border="0" cellpadding="0" cellspacing="0" width="100%" class="shop-home-table">
<tbody>
	<?php for($i = 0 ; $i < $_row ; $i++):?>
    <tr>
    	<?php for($j = 0 ; $j < $_column; $j++):?>
        	<?php if(isset($this->items[$i*$_column+$j])):
			$item = $this->items[$i*$_column+$j];
			$link = JRoute::_('index.php?option=com_shop&view=detail&id='.$item->id.':'.$item->alias);
			?>
            <td width="<?php echo $per; ?>%" valign="top">
            <div class="shop-home-item-p">
            	<a href="<?php echo $link; ?>" title="<?php echo $item->vtitle; ?>"><img src="<?php echo $this->path_img.'thumb/'.$item->image; ?>" alt="<?php echo $item->alias; ?>" title="<?php echo $item->vtitle; ?>"  class="shop-home-pape-img" /></a>
                <div class="item_p_title"><h2><a href="<?php echo $link; ?>" title="<?php echo $item->vtitle; ?>"><?php echo $item->vtitle; ?></a></h2>
                </div>
                <div class="shop-home-introtext">
				<?php 
                $introtext = $this->getText($item->introtext, 3);
                echo $introtext;
                ?>
                </div>
            </div>
            </td>
            <?php else:?>
            <td width="<?php echo $per;?>%"></td>
            <?php endif;?>
        <?php endfor;?>
    </tr>
    <?php endfor;?>
</tbody>
<tfoot>
<tr>
	<td colspan="<?php echo $_column; ?>"><?php echo $this->pagination->getPagesLinks(); ?></td>
</tr>
</tfoot>
</table>